import java.util.ArrayList;
import java.util.List;

// 动物类
class Animal {
    String name;

    public Animal(String name) {
        this.name = name;
    }

    void makeSound() {
        System.out.println(name + " the Animal makes a sound.");
    }

    void move() {
        System.out.println(name + " the Animal is moving.");
    }
}

// 定义一个接口，规范动物园工作人员的行为
interface ZooWorkerInterface {
    void performDuty();
}

// 动物园工作人员类
class ZooWorker implements ZooWorkerInterface {
    String name;
    Zoo zoo;

    public ZooWorker(String name, Zoo zoo) {
        this.name = name;
        this.zoo = zoo;
    }

    // 实现接口中定义的方法
    public void performDuty() {
        System.out.println(name + " is performing their duty.");
    }
}

// 园长类，继承自 ZooWorker，并且实现特定的职责
class Director extends ZooWorker {
    public Director(String name, Zoo zoo) {
        super(name, zoo);
    }

    @Override
    public void performDuty() {
        super.performDuty(); // 调用父类的 performDuty 方法
        zoo.showAnimals(); // 园长特有的行为
    }
}

// 动物园类
class Zoo {
    private List<Animal> animals = new ArrayList<>();
    private List<ZooWorkerInterface> workers = new ArrayList<>();

    public void addAnimal(Animal animal) {
        animals.add(animal);
    }

    public void addWorker(ZooWorkerInterface worker) {
        workers.add(worker);
    }

    public void showAnimals() {
        for (Animal animal : animals) {
            animal.makeSound();
            animal.move();
        }
    }

    public void showWorkers() {
        for (ZooWorkerInterface worker : workers) {
            System.out.println("Worker: " + worker.getClass().getSimpleName());
            worker.performDuty();
        }
    }
}

// 主程序
public class ZooApp {
    public static void main(String[] args) {
        Zoo zoo = new Zoo();

        // 添加动物
        zoo.addAnimal(new Animal("Leo"));
        zoo.addAnimal(new Animal("Tiggy"));

        // 添加工作人员，包括园长
        ZooWorker director = new Director("Dr. Jane", zoo); // 使用 Director 类表示园长
        zoo.addWorker(director);

        // 展示动物园的动物和工作人员
        System.out.println("Animals in the Zoo:");
        zoo.showAnimals();
        System.out.println("\nZoo Workers:");
        zoo.showWorkers();
    }
}